<%@ page language="java" pageEncoding="UTF-8" buffer="16kb"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<%@ include file="/module/js.jsp"%>
<%@ include file="/module/orderField.jsp"%>
 
<style>

table label.error {
    margin-left: 5px;
    width: auto;
    display: inline;
    color: red;
}
</style>







</head>
<body>
     <form action="#" name="Form" id="Form" method="post">
           <input type="hidden" name="states" id="states"  value="0"/>
           <input type="hidden" name="bjid" id="bjid"  value="${student.bjid}"/>
           <input type="hidden" name="stuid" id="stuid"  value="${student.xsid}"/>
		   	<table cellpadding="0" cellspacing="0" border="0" class="table-border"
			width="95%">
			<tr>
				<td class="table-header" colspan="6">困难生认定申请</td>
			</tr>
			<tr>
				<td class="table-titleTD" style="width: 12%">姓名：</td>
				<td class="table-contentTD" style="width: 21%">${student.xm}</td>
				<td class="table-titleTD"  style="width: 12%">学号：</td>
				<td class="table-contentTD" style="width: 21%">${student.xh}</td>
				<td class="table-titleTD" style="width: 12%">性别：</td>
				<td class="table-contentTD" style="width: 22%">${student.xb}</td>
			</tr>
			<tr>
				<td class="table-titleTD">班级：</td>
				<td class="table-contentTD">${student.bjmc}</td>
				<td class="table-titleTD">专业：</td>
				<td class="table-contentTD">${student.zymc}</td>
				<td class="table-titleTD">年级：</td>
				<td class="table-contentTD">${student.njmc}</td>
			</tr>
			
			<tr>
				<td class="table-titleTD">出生日期：</td>
				<td class="table-contentTD">${student.csrq1}</td>
			
				<td class="table-titleTD">民族：</td>
				<td class="table-contentTD"><select id="mz" name="mz"  style="width: 50%" class="selectList">
						<option value="">请选择</option>
							 <c:forEach items="${nationList}" var="code">
								<option value="${code.codename}">${code.codename}</option>
							</c:forEach>
				</select></td>
				<td class="table-titleTD">政治面貌：</td>
				<td class="table-contentTD"><select id="zzmm" name="zzmm"  class="selectList">
						<option value="">无</option>
						<c:forEach items="${sysCodeList}" var="code">
							  <option value="${code.codename}">${code.codename}</option>
						</c:forEach>
				</select></td>
			</tr>
			
			<tr>
			    <td class="table-titleTD">户口所在地：</td>
			    <td class="table-contentTD">
				<input type="text" name="hjszd" id="hjszd" placeholder="户口所在地" class="inputText" value="${student.hkszd}"  autocomplete="off"/></td>
			  
			    <td class="table-titleTD">联系电话：</td>
			    <td class="table-contentTD">
				<input type="text" name="lxdh" id="lxdh" placeholder="联系电话"     class="inputText" value="${student.sjhm}"  autocomplete="off"/></td>
				
			</tr>
			
			<tr>
			   <td class="table-titleTD"><font style="color: red;">*</font>申请认定理由：</td>
			   <td colspan="7" class="table-contentTD" style="color: #000000" >
						 <label><input type="checkbox" id="dbz" name="dbz" value="true" />有效期内的低保证（含杭州市困难家庭救助证、低保边缘证）；证号：<input type="text" name="dbzh" id="dbzh" placeholder="请输入"  style="width: 30%" class="inputText"  autocomplete="off"/></label><br />
						 <label><input type="checkbox" id="fljgzm" name="fljgzm" value="true" />福利机构监护对象证明；</label><br />
						 <label><input type="checkbox" id="gmlszn" name="gmlszn" value="true" />革命烈士子女证明；</label><br />
						 <label><input type="checkbox" id="wbgydx" name="wbgydx" value="true" />五保供养对象证明；</label><br />
						 <label><input type="checkbox" id="cjz" name="cjz" value="true" />残疾学生残疾证；证号：<input type="text" name="cjzh" id="cjzh" placeholder="请输入"   class="inputText" style="width: 30%" autocomplete="off"/></label><br />
						 <label><input type="checkbox" id="sqzm" name="sqzm" value="true" />社区（街道）签署意见并盖章后的《杭州市中等职业学校助学金申请表》及相关收入证明；</label><br />
						 <label><input type="checkbox" id="qtzj" name="qtzj" value="true" />其他证件（含证号）:<input type="text" name="qtzjsm" id="qtzjsm" placeholder="请输入"   class="inputText"  style="width: 30%" autocomplete="off"/> </label>
				 </td>
			</tr>
			<tr>
				<td class="table-titleTD">备注:</td>
				<td class="table-contentTD" colspan="6" style="width: 100%"><textarea style="width: 90%;height: 80px;" name="remark"  autocomplete="off" placeholder="备注" id="remark" maxlength="2000" ></textarea></td>
			</tr>
		</table>
		
		 </form> 
		<br />
		
		<table cellpadding="1" cellspacing="1" border="0" align="left">
			<tr>
			    <td><input type="button" id="btnSave" class="inputButton"  autocomplete="off" 
					style="text-align: center;" value="保存" /></td>
				<td><input type="button" id="btnSaveContinue" class="inputButton" autocomplete="off" 
					style="text-align: center;" value="保存并新增" /></td>
				<td><input type="button" id="Cancel" class="inputButton" autocomplete="off"
					style="text-align: center;" value="取消" /></td>
				<td><input type="button" id="returnBut" class="inputButton" autocomplete="off"
					value="返回" style="text-align: center;" /></td>
			</tr>
		 </table>
		
		 
			
		<script>
			$(document).ready(function() {
				var _form=$("#Form").validate();
				$("#btnSave").click(function() {
					if(_form.form()){
						
						var checks =$("input[type='checkbox']");
						var ids = "";
						if(checks&&checks.length>0){
							for(var i=0;i<checks.length;i++){
								if(checks[i].checked){
									if(ids.length>0)ids+=",";
									ids+=checks[i].value;
								}
							}
						}
						if(ids==''){
								layer.alert("请至少选择一个申请认定理由", {icon: 5});
								return false; 
						}
						validataSave();
					}
				});
				
				$("#btnSaveContinue").click(function() {
					if(_form.form()){
						
						var checks =$("input[type='checkbox']");
						var ids = "";
						if(checks&&checks.length>0){
							for(var i=0;i<checks.length;i++){
								if(checks[i].checked){
									if(ids.length>0)ids+=",";
									ids+=checks[i].value;
								}
							}
						}
						if(ids==''){
								layer.alert("请至少选择一个申请认定理由", {icon: 5});
								return false; 
						}
						 validataSaveContinue();
					}
				});
				
				function validataSave(){
				  /* 	$.ajax({
						  type: 'POST',
						  url: "${basePath}/twglStudentCadre/validation",
					      data:{xmmc : $('#xmmc').val(),id:null},
						  success:function(data){
						   if(data.msg=="-99"){
							     layer.alert('服务器异常', {icon: 5});
							     return false;
						   }else if(data.msg!='0'){
							     layer.alert('申请人名称已经存在请重新输入', {icon: 5});
							     return false;
						   }else{ */
							   var ok=true;
							   if($("#dbz").is(":checked")==true){
								  var dbzh= $("#dbzh").val();
								  if(dbzh==''){
									 layer.alert('有效期内的低保证不能为空', {icon: 5});
									 $("#dbzh").focus();
									 ok=false;
								     return false;
								  }
							   }
							   if($("#cjz").is(":checked")==true){
									  var cjzh= $("#cjzh").val();
									  if(cjzh==''){
										 layer.alert('残疾学生残疾证号不能为空', {icon: 5});
										 $("#cjzh").focus();
										 ok=false;
									     return false;
									  }
							   }
							   if($("#qtzj").is(":checked")==true){
									  var qtzjsm= $("#qtzjsm").val();
									  if(qtzjsm==''){
										 layer.alert('其他证件号不能为空', {icon: 5});
										 $("#qtzjsm").focus();
										 ok=false;
									     return false;
									  }
							   }
							   if(ok==true){
								    document.Form.action ="${basePath}/zxjDifficultStudent/add";
									document.Form.submit();
							   }
							  
						  /*  }   
						  }
						});	 */
				}
				
				
				function validataSaveContinue(){
				  /* 	$.ajax({
						  type: 'POST',
						  url: "${basePath}/twglStudentCadre/validation",
					      data:{xmmc : $('#xmmc').val(),id:null},
						  success:function(data){
						   if(data.msg=="-99"){
							     layer.alert('服务器异常', {icon: 5});
							     return false;
						   }else if(data.msg!='0'){
							     layer.alert('申请人名称已经存在请重新输入', {icon: 5});
							     return false;
						   }else{ */
							 
					  var ok=true;
					   if($("#dbz").is(":checked")==true){
						  var dbzh= $("#dbzh").val();
						  if(dbzh==''){
							 layer.alert('有效期内的低保证不能为空', {icon: 5});
							 $("#dbzh").focus();
							 ok=false;
						     return false;
						  }
					   }
					   if($("#cjz").is(":checked")==true){
							  var cjzh= $("#cjzh").val();
							  if(cjzh==''){
								 layer.alert('残疾学生残疾证号不能为空', {icon: 5});
								 $("#cjzh").focus();
								 ok=false;
							     return false;
							  }
					   }
					   if($("#qtzj").is(":checked")==true){
							  var qtzjsm= $("#qtzjsm").val();
							  if(qtzjsm==''){
								 layer.alert('其他证件号不能为空', {icon: 5});
								 $("#qtzjsm").focus();
								 ok=false;
							     return false;
							  }
					   }
					          if(ok==true){
								    document.Form.action ="${basePath}/zxjDifficultStudent/addSaveContinue";
									document.Form.submit();  
							   }
							   
						 /*   }   
						  }
						});	 */
				}
				$("#returnBut").click(function() {
		 			   window.location.href='${basePath}/zxjDifficultStudent/index';
		 		});
				
				$("#Cancel").click(function() {
					   window.location.href = "${basePath}/zxjDifficultStudent/addInInt";
		 		});
			});
			
			   if("${msg}"!=""){
			       layer.alert("${msg}", {icon: 6});
			  } 
			   
	
	      compareListValue(document.getElementById('zzmm'),'${student.zzmm}');
	      compareListValue(document.getElementById('mz'),'${student.mz}');
			
		</script>
</body>
</html>
